package com.nondo.auth;

import com.google.common.base.Joiner;
import com.nondo.dean.auth.common.TokenPrincipal;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;

import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author yuechang yuechang5@hotmail.com
 * @ClassName: JsqlparserDemo
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2015年9月2日 上午11:40:59
 */
public class JsqlparserDemo {


    public static void main(String[] args) {
        /*demo();*/
    }

    /*public static void demo() {
        Configuration c = new Configuration(Configuration.VERSION_2_3_0);
        Template template = null;
        try {
            template = new Template("test", new StringReader("user_id in (${user.dea2lerIds}) and user_id = ${user.userId} and sd in (${user.roles})"), c);

            StringWriter out = new StringWriter();

            TokenPrincipal tokenPrincipal = new TokenPrincipal(1L, "123", "123", "231", "1231,12312,123", new HashMap<>());

            Map<String, Object> root = new HashMap<>();
            root.put("user", tokenPrincipal.getParams());
            template.process(root, out);

            System.out.println(out.toString());

        } catch (IOException e) {
            e.printStackTrace();
        } catch (TemplateException e) {
            e.printStackTrace();
        }

    }*/

}